<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获取 GeoIP 数据库的信息</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.geoip-country-name-by-name.html">« geoip_country_name_by_name</a></li>
      <li style="float: right;"><a href="function.geoip-db-avail.html">geoip_db_avail »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.geoip.html">GeoIP 函数</a></li>
    <li>获取 GeoIP 数据库的信息</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.geoip-database-info" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">geoip_database_info</h1>
  <p class="verinfo">(PECL geoip &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">geoip_database_info</span> &mdash; <span class="dc-title">获取 GeoIP 数据库的信息</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.geoip-database-info-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>geoip_database_info</strong></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$database</code><span class="initializer"> = GEOIP_COUNTRY_EDITION</span></span>): <span class="type">string</span></div>


  <p class="para rdfs-comment">
   <span class="function"><strong>geoip_database_info()</strong></span> 函数返回 GeoIP 数据库版本的信息。
  </p>
  
  <p class="para">
   如果无参调用该函数，则返回 GeoIP 免费国家版的版本信息。
  </p>

 </div>

 <div class="refsect1 parameters" id="refsect1-function.geoip-database-info-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">database</code></dt>

     <dd>

      <p class="para">
       该变量的类型为整型。你可以使用该扩展的<a href="geoip.constants.html" class="link">预定义常量</a>(类似: GEOIP_*_EDITION)。
      </p>

     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.geoip-database-info-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   如果成功，返回数据库的版本信息，错误则返回<strong><code>null</code></strong> 。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.geoip-database-info-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3382">
    <p><strong>示例 #1  <span class="function"><strong>geoip_database_info()</strong></span> 函数的使用范例：</strong></p>
    <div class="example-contents"><p>
     以下代码将会输出数据库的相关信息。
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">print&nbsp;</span><span style="color: #0000BB">geoip_database_info</span><span style="color: #007700">(</span><span style="color: #0000BB">GEOIP_COUNTRY_EDITION</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
GEO-106FREE 20060801 Build 1 Copyright (c) 2006 MaxMind LLC All Rights Reserved
</pre></div>
    </div>
   </div>
  </p>
 </div>

  
</div></div></div></body></html>